<script setup lang="ts">
defineOptions({
  name: "BenchCompWrapper"
});
const props = withDefaults(defineProps<{ title?: string; titleWidth?: string }>(), {
  title: "",
  titleWidth: "310"
});
</script>

<template>
  <div class="bench-comp">
    <div class="bench-comp-title" :style="`width: ${titleWidth}px`">
      <slot name="title">{{ title }}</slot>
    </div>
    <div class="bench-comp-content"><slot name="content" /></div>
    <div class="bench-comp-btn"><slot name="btn" /></div>
  </div>
</template>

<style lang="scss" scoped>
.bench-comp {
  position: relative;
  width: 100%;
  padding: 16px 24px;
  margin-bottom: 16px;
  overflow: hidden;
  background: #fff;
  border-radius: 4px;
  // box-shadow: 0 2px 10px 0 rgb(0 37 86 / 12%);

  &-title {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    max-width: 100%;
    height: 32px;
    padding-left: 10px;
    font-size: 16px;
    font-weight: 700;
    line-height: 25px;
    color: #000;
    background: linear-gradient(270deg, rgb(59 130 246 / 0%) 0%, rgb(59 130 246 / 24%) 100%);
    border-left: 3px solid #3b82f6;
  }

  &-content {
    width: 100%;
    flex-grow: 1;
    height: calc(100% - 30px);
  }

  &-btn {
    position: absolute;
    top: 16px;
    right: 24px;
  }
}
</style>
